var NAV = {};
(function(){
	var lis = document.getElementById("nav").getElementsByTagName("a"),
			lisNum = lis.length,
			i;

	for(i=0;i<lisNum;i++){
			lis[i].onclick=function(){
					for (var j=0;j<lisNum;j++){
							lis[j].parentNode.className = "";
					}
					this.parentNode.className="current";
					if (this.parentNode.nodeName.toLowerCase() != "h2"){
							this.parentNode.parentNode.parentNode.getElementsByTagName("h2")[0].className="current";
					}
					scroll(0,0);
			};
	}
	
	NAV.current = function(cateIndex,liIndex){
			for (var j=0;j<lisNum;j++){
					lis[j].parentNode.className = "";
			}
			lis[cateIndex].parentNode.className = lis[liIndex].parentNode.className = "current";
	}
})();